package com.monochromebytes.mononet.virtual;

import java.io.IOException;

public interface ConnectionSocketListener {

    /**
     * Will be invoked when a new Connection has been created by the
     * ConnectionSocket, the listener is observing.
     * 
     * @param socket
     *            The socket that has been closed.
     * @param e
     *            The Exception that was thrown or null.
     */
    public void connected(ConnectionSocket socket, Connection connection);

    /**
     * Will be invoked when a ConnectionSocket, the listener is
     * observing, has been closed.
     * 
     * @param socket
     *            The socket that has been closed.
     * @param e
     *            The Exception that was thrown or null.
     */
    public void socketClosed(ConnectionSocket socket, IOException e);

    /**
     * Will be invoked when a ConnectionSocket, the listener is
     * observing, has been opened.
     * 
     * @param socket
     *            The socket that has been opened.
     */
    public void socketOpened(ConnectionSocket socket);
}
